import request from '@/utils/request'

export function titQuery(data) {
  return request({
    url: `/md/commonBrowsers/selectPageItem`,
    method: 'post',
    data
  })
}

export function search(data) {
  return request({
    url: `/md/items/query/?item=${data.materielCode}&version=${data.version}`,
    method: 'get'
  })
}

export function save(data) {
  return request({
    url: `/md/items/save`,
    method: 'post',
    data: data
  })
}

export function deleteItem(data, dataTime) {
  return request({
    url: `/md/items/delete/?item=${data.materielCode}&version=${data.version}&modifyDate=${dataTime.modifyDate}`,
    method: 'get'
  })
}

export function bomSearch(data) {
  return request({
    url: `/md/commonBrowsers/selectPageBom`,
    method: 'post',
    data: data
  })
}

export function WHSearch(data) {
  return request({
    url: `/md/commonBrowsers/selectPageWarehouse`,
    method: 'post',
    data: data
  })
}

export function ItemGroupListSearch() {
  return request({
    url: `/md/items/selectItemGroup`,
    method: 'get'
  })
}

export function getItemCustomData() {
  return request({
    url: `/md/commonCustomDatas/getItemCustomData`,
    method: 'get'
  })
}
